package com.example.demossssssssss.Service.lmpl;

import com.example.demossssssssss.Entity.News;
import com.example.demossssssssss.Mapper.NewsMapper;
import com.example.demossssssssss.Service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
//给新闻添加返回成功或者不成功
@Service
public class NewsServicelmpl implements NewsService  {

    @Autowired
    private NewsMapper newsMapper;

    //类名 对象
    @Override
    public Boolean addNews(News dog) {
        //if 里是返回值
        if ( newsMapper.addNews(dog) == 1 ){
            return true;
        }
        else {
            return false;
        }
    }
}
